package item14;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class Gather {

	public static void main(String[] args) {
		List<String> list = new ArrayList<>();
		List<String> link = new LinkedList<>();
		list.add("a");
		list.add("b");
		list.add("c");
		link.add("d");
		link.add("e");
		link.add("f");
		link.add(3, "ee");
		Iterator<String> it = link.iterator();
		for (int i = 0; i < link.size(); i++) {
			System.out.println(link.get(i));
		}
		while (it.hasNext()) {
			String string = (String) it.next();
			System.out.println(string);
		}
	}

}
